#include "simplemap.hpp"
#include <string>
using namespace std;

bool tryMove(SimpleMap &graph, const string &directionString) {
	std::vector<std::string> blocked = graph.getBlockedNeighborStrings();
	for(unsigned int i = 0; i < blocked.size(); i++)
		if(directionString.compare(blocked[i]) == 0) {
			return false;
		}
	return true;
}

int main() {
	SimpleMap graph("maze.dat");

	if(tryMove(graph, "NORTH")) fprintf(stderr, "OKAY\n");
	else fprintf(stderr, "NOT OKAY\n");

	graph.updatePosition("NORTH");

	if(tryMove(graph, "NORTH")) fprintf(stderr, "OKAY\n");
	else fprintf(stderr, "NOT OKAY\n");

	graph.updatePosition("NORTH");

	if(tryMove(graph, "NORTH")) fprintf(stderr, "OKAY\n");
	else fprintf(stderr, "NOT OKAY\n");

	graph.updatePosition("NORTH");

	if(tryMove(graph, "WEST")) fprintf(stderr, "OKAY\n");
	else fprintf(stderr, "NOT OKAY\n");

	graph.updatePosition("WEST");

	if(tryMove(graph, "EAST")) fprintf(stderr, "OKAY\n");
	else fprintf(stderr, "NOT OKAY\n");

	graph.updatePosition("EAST");

	if(tryMove(graph, "NORTH")) fprintf(stderr, "OKAY\n");
	else fprintf(stderr, "NOT OKAY\n");

	graph.updatePosition("NORTH");

	return 0;
}
